import request from "@/utils/service.js";


// 桌位渲染
export let findAlldining = () => {
    return request({
        url: "/dining/findAlldining",
        method: "GET",

    })
}

// 点餐的查询

// 跳转到点餐 的渲染

export let findAll = () => {
    return request({
        url: "/food/findAll",
        method: "GET",

    })
}

// 全部：根据菜名模糊查询
export let findByLike = (foodName) => {
    return request({
        url: "/findByLike",
        method: "GET",
        params: {
            foodName
        }
    })
}



// 根据销量查询
export let findSort = () => {
    return request({
        url: "/food/findSort",
        method: "GET",

    })
}

// 显示所有打折菜品查询

export let findDiscount = () => {
    return request({
        url: "/food/findDiscount",
        method: "GET"
    })
}

// 菜品类别id查询(凉菜)

export let findbylimitAndsort = () => {
    return request({
        url: "/food/findbylimitAndsort",
        method: "GET",
        params: {
            sortId: 2
        }
    })
}

// 点击菜品，加入订单（带订单ID）

export let addOrder = (obf) => {
    return request({
        url: "/food/addOrder",
        method: "POST",
        data:obf
    })
}

// 下面footer的 添加在备注中

export let beizhu = () => {
    return request({
        url: "",
        method: ""
    })
}


// 订单的接口

// 删除单个菜品
export let deleteOneFood = () => {
    return request({
        url: "/food/deleteOneFood",
        method: "GET",
        params: {
            foodId: "",
            orderId: ""
        }
    })
}

// // 菜品减一
// export let subfood = () => {
//     return request({
//         url: "/food/subfood",
//         method: "GET",
//         params: {
//             foodId: 123456,
//             orderId: ""
//         }
//     })
// }

// // 菜品加一
// export let addOnefood = () => {
//     return request({
//         url: "/food/addOnefood",
//         method: "GET",
//         params: {
//             foodId: 123456,
//             orderId: ""
//         }
//     })
// }

// // 清空购物车
// export let clearOrder = () => {
//     return request({
//         url: "/clearOrder",
//         method: "GET"
//     })
// }

// 传桌号  查询所有餐桌
export let zfindAll = () => {
    return request({
        url: "dining/findAll",
        method: "GET"
    })
}

// 结账
export let payOrder = (orderId) => {
    return request({
        url: "/order/pay",
        method: "POST",
        data: {
            orderId
        }
    })

} 